use chrono::Datelike;

pub trait ArrowDateExt: Datelike {
    fn safe_quarter(&self) -> u32 {
        match self.month() {
            1..=3 => 1,
            4..=6 => 2,
            7..=9 => 3,
            10..=12 => 4,
            _ => unreachable!(),
        }
    }
}

impl<T: Datelike> ArrowDateExt for T {}